<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        
        var arr = [1500,1200,2000,2100,1800];
        var newArr = [];
        for(var i=0;i < arr.length;i++){
            if(arr[i] < 2000){
                newArr.push(arr[i]);
            }
        }
        console.log(newArr);


        var arr1 = ['red','blue','pink'];
        arr1.reverse();
        console.log(arr1);

        //冒泡排序
        var arr2 = [13,4,77,1,7];
        arr2.sort(function(a,b){
            // return a - b; //按照升序排
            return b - a; //按照降序排
        });
        console.log(arr2);
     
 
    </script>
</head>
<body>
    
</body>
</html>